<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/swiper-4.3.5.min.css">
    <link rel="stylesheet" href="../css/element.css">
    <link rel="stylesheet" href="../css/main.css">
    <link rel="stylesheet" href="../css/person_center/person_center.css">
    <title>会员中心-浏览足迹</title>
</head>

<body>
    <div id="app" v-cloak>
        <headers></headers>
        <!-- search -->
        <div class="search wrap">
            <logo></logo>
            <div class="header_tit fl"></div>
            <searchs></searchs>

            <car_box></car_box>

        </div>
        <div class="wrap person_center">
            <!-- nav -->
            <div class="nav_box fl">
                <div id="subapp" v-cloak>
                    <div class="person_nav fl">
                        <ul>
                            <li @click='person_order'>首页</li>
                            <li @click='person_center'>我的订单</li>
                            <li @click='person_address'>收货地址</li>
                            <li @click='person_exchange_page'>积分换货</li>
                            <li @click='person_intergal'>积分订单</li>
                            <li @click='person_collection'>我的收藏</li>
                            <li class="active">浏览足迹</li>
                            <li @click='person_ticket'>优惠券</li>
                            <li @click='person_info'>个人设置</li>
                            <li @click='person_message'>消息中心</li>
                        </ul>
                    </div>
                </div>
            </div>

            <div class="right_box fl">
                <!-- <div class="footprint_data_box" v-for="item in address"> -->
                <div class="footprint_data_box">
                    <div class="footprint_data">
                        <!-- <div class="data_detail">10月31日</div> -->
                        <div class="data_detail">浏览足迹</div>
                        <div class="clear_history" @click='clearHistory'>清空浏览足迹</div>
                    </div>
                    <div class="collection_list clear_both">
                        <div class="collection_item fl" v-for='(foot,index) in spuList'>
                            <div class="collection_img cursor" @click='detail(foot.id)' >
                                <img :src="foot.coverImg" alt="">
                            </div>
                            <p class="collection_tit">{{foot.spuName}}</p>
                            <div class="collection_money">
                                <span>￥</span>{{foot.showPrice}}
                            </div>
                            <div class="del_collection" v-show="index===del_index">
                                <img src="../images/icon_del_0.png" alt="">
                            </div>
                        </div>
                    </div>
                    
                    <!-- <div class="integral_page">
                        <el-pagination background layout="prev, pager, next" @current-change="handleCurrentChange"   :page-size='10' :total="total" class="page_list">
                        </el-pagination>
                    </div> -->
                </div>
                


            </div>

        </div>




       <div class="wrap clear_both">             <productfooter></productfooter>         </div>

    </div>
     
    <script src="../js/axios.js"></script>         <script src="../js/qs.js"></script>
    <script src="../js/swiper-4.3.5.min.js"></script>
    <script src="../js/browser.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../js/element.js"></script>
    <script src="../js/main.js"></script>
    <script type="text/babel">
        var app = new Vue({
            el: '#app',
            data() {
                return {
                    address:3,
                    car_active:false,
                    groups:3,
                    add_popup:false,
                    spuList:'',
                    del_index:'',
                    total:0
                };
            },
            created() {
                
            },
            mounted() {
                this.getHistoryList()
            },
            methods: {
                detail(id){
                    window.location.href='../product/product_detail.html?id='+id
                },
                handleCurrentChange(page) {
                    // this.listCoupons(page)
                }, //改变条数触发
                handleIndexChange(index) {
                    console.log(index)
                },
                // 足迹列表
                getHistoryList(){
                    axios({
                        method:"POST",
                        url:base_url + "/web/mdse/getHistoryList",
                        data:Qs.stringify({
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        console.log(res.data.data)
                        app.spuList = res.data.data.spuList
                        app.total = res.data.data.spuList.length
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 清空足迹列表
                clearHistory(){
                    axios({
                        method:"POST",
                        url:base_url + "/web/mdse/clearHistory",
                        data:Qs.stringify({
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        if (res.data.code==1) {
                            app.$message.success("清除成功");
                            app.getHistoryList()
                        }
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 显示购物车               
                go_shop_car(){                     
                    window.location.href='../product/shop_car.html'  
                },
                car_box(){
                    this.car_active = !this.car_active
                },
                person_order(){
                    window.location.href='person_order.html'
                },
                person_address(){
                    window.location.href='person_address.html'
                },
                person_exchange_page(){
                    window.location.href='person_exchange_page.html'
                },
                person_center(){
                    window.location.href='person_center.html?index='+0
                },
                person_intergal(){
                    window.location.href='person_integral_order.html'
                },
                person_collection(){
                    window.location.href='person_collection.html'
                },
                person_info(){
                    window.location.href='person_info.html'
                },
                person_message(){
                    window.location.href='person_message.html'
                },
                person_ticket(){
                    window.location.href='person_ticket.html'
                }
            }
        })
        
    </script>
</body>

</html>